/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * GUIcomConfig.java
 *
 * Created on 26-nov-2010, 20:39:37
 */

package interfaz;

/**
 *
 * @author Felipe
 */
public class GUIComConfig extends javax.swing.JDialog {

    private String com;

    /** Creates new form GUIcomConfig */
    public GUIComConfig(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        initComponents();
    }

    public String getSel(){return com;}

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        _btnOk = new javax.swing.JButton();
        _cmbCom = new javax.swing.JComboBox();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Selección de puerto");

        _btnOk.setText("Ok");
        _btnOk.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                _btnOkActionPerformed(evt);
            }
        });

        _cmbCom.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "COM1", "COM2", "COM3", "COM4", "COM5", "COM6", "COM7", "COM8", "COM9", "COM10" }));
        _cmbCom.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                _cmbComActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(32, 32, 32)
                .addComponent(_cmbCom, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(29, 29, 29)
                .addComponent(_btnOk)
                .addContainerGap(31, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(32, 32, 32)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(_btnOk)
                    .addComponent(_cmbCom, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(38, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void _cmbComActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event__cmbComActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event__cmbComActionPerformed

    private void _btnOkActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event__btnOkActionPerformed
        com = _cmbCom.getSelectedItem().toString();
        this.dispose();
    }//GEN-LAST:event__btnOkActionPerformed



    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton _btnOk;
    private javax.swing.JComboBox _cmbCom;
    // End of variables declaration//GEN-END:variables

}
